www.gusucode.com > TinyShop PHP开源商城系统 v1.0.3PHP源码程序 > TinyShop PHP开源商城系统 v1.0.3/TinyShop_v1.0.3/TinyShop_v1.0.3/protected/extensions/ControllerExt.php

    <?php
//控制器
class ControllerExt implements Extension
{
    public function before($obj=null)
    {
        //测试平板或者手机端主题
        //$clientType = Chips::clientType();
        //if($clientType=='tablet')Tiny::app()->setTheme("tablet");
        $config = Config::getInstance();
        $site = $config->get('globals');
        $other = $config->get('other');
        $currency_symbol = isset($other['other_currency_symbol'])?$other['other_currency_symbol']:'¥';
        $site_logo = (isset($site['site_logo'])&&$site['site_logo']!='')?$site['site_logo']:'static/images/logo.png';
        $site_name = isset($site['site_name'])?$site['site_name']:'TinyShop商城';
        $site_icp = isset($site['site_icp'])?$site['site_icp']:'鲁ICP备00000100号';
        
        $obj->assign('currency_symbol',$currency_symbol);
        $obj->assign('site_logo',$site_logo);
        $obj->assign('site_name',$site_name);
        $obj->assign('site_icp',$site_icp);
    }
    public function after($obj=null)
    {
    }
}